package com.smartstores;

import com.smartstores.R;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.*;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TabHost;

public class Principal extends TabActivity {

	private static final int CARRITO_INTENT = 0;
	private static final int LISTAS_INTENT = 1;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		Resources res = getResources(); // Resource object to get Drawables
		TabHost tabHost = getTabHost(); // The activity TabHost
		TabHost.TabSpec spec; // Resusable TabSpec for each tab
		Intent intent; // Reusable Intent for each tab

		// Create an Intent to launch an Activity for the tab (to be reused)
//		intent = new Intent().setClass(this, ScannerActivity.class);

		// Initialize a TabSpec for each tab and add it to the TabHost
		intent = new Intent().setClass(this, ScannerActivity.class);
		spec = tabHost.newTabSpec("scanner")
				.setIndicator("Scanner", res.getDrawable(R.layout.tabscanner))
				.setContent(intent);
		tabHost.addTab(spec);

		// Do the same for the other tabs
		intent = new Intent().setClass(this, MapaActivity.class);
		spec = tabHost.newTabSpec("mapa")
				.setIndicator("Mapa", res.getDrawable(R.layout.tabmapa))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, PromocionActivity.class);
		spec = tabHost
				.newTabSpec("promocion")
				.setIndicator("Promocion",
						res.getDrawable(R.layout.tabpromocion))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, CarritoActivity.class);
		spec = tabHost.newTabSpec("carrito")
				.setIndicator("Carrito", res.getDrawable(R.layout.tabcarrito))
				.setContent(intent);
		tabHost.addTab(spec);

		tabHost.setCurrentTab(0);
	}
	
	
}